<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<script src="js/jquery-3.2.1.js"></script>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
	$(function(){
		//门店下拉列表发生改变
		$("select[name=storelist]").change(function(){
			var store_id = $(this).val();
			alert(store_id);
			$.getJSON("storechange",{store_id:store_id},function(e2){
				//修改车辆表的下拉列表
				$("select[name=carlist]").children().remove();
				for(var i=0;i<e2.length;i++){
					$("select[name=carlist]").append("<option value='"+e2[i].id+"'>"+e2[i].name+"</option>")
					//$("select[name=carlist]").append(e3[i].sname);
				}
			});
		})
		
	})
</script>
</head>
<body>
	<c:set var="isDoing" value="0" />
	<c:forEach items="${powerList}" var="power" varStatus="status">
		<c:if test="${power.name=='新增车辆' && isDoing==0}" var="u">
			<!--  设置跳出 条件 -->
			<c:set var="isDoing" value="1" />
			<div>
				<ul style="margin-top:50px;">
					<form enctype="multipart/form-data" id="addnewcar" action="addcarfile" method="post">
						<li style="margin-left:50px;margin-top:20px">
							<select name="storelist">
								<option selected="selected" value="">请选择门店</option>
								<c:forEach items="${storelist}" var="store">
									<option value="${store.id}">${store.name }</option>
								</c:forEach>
							</select>
							<select name="carlist">
								<option value="">请选择车辆</option>
							</select>
						</li>
						<li style="margin-left:50px;margin-top:20px">
							车牌：<input type="text" name="chepai" value="HK111"></br>
							上：<input type="file" name="f">
							下：<input type="file" name="f">
							左：<input type="file" name="f">
							右：<input type="file" name="f">
							前：<input type="file" name="f">
							后：<input type="file" name="f">
							内：<input type="file" name="f">
							
						</li>
						<li style="margin-left:50px;margin-top:20px">
							备注：</br>
							<textarea name="condition"></textarea>
							</br>
							<input style="margin-top:20px;" type="submit" value="上传">
						</li>
					</form>
				</ul>
			</div>
		</c:if>
		<c:if test="${fn:length(powerList) == status.count && isDoing==0 }">
			<c:if test="${!u }">
				<jsp:include page="403.jsp"></jsp:include>
			</c:if>
		</c:if>
	</c:forEach>

</body>
</html>